|
|
|
|
|
|
|
Assigning shortcut keys is simply a process of selecting the key or keys that you want to use from the Shortcut drop-down list. Shortcut key are displayed to the right of the menu item both in the selection list (see Figure 4.23) in the Menu Editor and in the actual menu in your application. |
|
|
|
|
|
|
|
|
Figure 4.23.
Shortcuts are displayed in the menu item
selection list. |
|
|
|
|
|
|
|
|
Because of the way shortcut keys work, only one shortcut key can use a given key combination. Therefore, you can have at most only 79 different shortcut keys in your application. |
|
|
|
|
|
|
|
|
Caution Just like with hotkeys, the shortcut key should correspond with the first letter of the menu item, whenever possible. |
|
|
|
|
|
|
|
|
|
Adding code for the menu is the same as adding code for any other control in your application. The big difference between the menu and other controls or objects on a form is that the menu has only one event procedurethe Click event. This event is triggered whenever you select the menu item by clicking it, by using the hotkey, or by using the shortcut key. To display the Click event routine for a menu item, simply click the menu item that you want to work with; its related Click event will appear in the code editor window. |
|
|
|
|
|
|
|
|
Note If you look at the code that you added to the dlgFileOpenCopy project in Day 1, notice that you had code in the mnuFileOpen_Click routine. |
|
|
|
|
|
|